//
//  YYTableViewCell.m
//  WeiDuYY
//
//  Created by 张继良 on 2019/1/23.
//  Copyright © 2019 W ke杨. All rights reserved.
//

#import "YYTableViewCell.h"
#import <SDAutoLayout/SDAutoLayout.h>
#import "Xitongxiaoxi.h"
@implementation YYTableViewCell

-(UIView *)view1{
    if (!_view1) {
        //初始化 view
        _view1 = [[UIView alloc]init];
        //添加
        [self.contentView addSubview:self.view1];
        //位置
         _view1.sd_layout.leftSpaceToView(self.contentView,20).topSpaceToView(self.contentView, 10).heightIs(86).widthIs(370);
        //将图层边框设置为圆角
        _view1.layer.cornerRadius = 5;
        _view1.layer.masksToBounds = YES;
        //给图层添加一个有色边框
        _view1.layer.borderWidth = 1;
        _view1.layer.borderColor = [[UIColor colorWithRed:204.0/255.0 green:204.0/255.0 blue:204.0/255.0 alpha:1] CGColor];
        //按钮
         UIButton *btn1 = [[UIButton alloc] init];
        //添加
        [self.view1 addSubview:btn1];
       btn1.sd_layout.leftSpaceToView(self.view1, 50).topSpaceToView(self.view1, 10).heightIs(55).widthIs(55);
        [btn1 setImage:[UIImage imageNamed:@"my_icon_messiage_default_hdpi"] forState:UIControlStateNormal];
        [btn1 addTarget:self action:@selector(buttonone) forControlEvents:UIControlEventTouchUpInside];
        //文字
        UILabel * lb1 = [[UILabel alloc]init];
        lb1.text=@"我的信息";
        lb1.font = [UIFont systemFontOfSize:13];
        //添加
        [self.view1 addSubview:lb1];
        lb1.sd_layout.leftSpaceToView(self.view1, 50).topSpaceToView(self.view1, 55).heightIs(30).widthIs(80);
    }
    return _view1;
}
-(UIView *)view2{
    if (!_view2) {
        //初始化 view
        _view2 = [[UIView alloc]init];
        //添加
        [self.contentView addSubview:self.view2];
        //位置
        _view2.sd_layout.leftSpaceToView(self.contentView,20).topSpaceToView(self.contentView, 106).heightIs(86).widthIs(370);
        //将图层边框设置为圆角
        _view2.layer.cornerRadius = 5;
        _view2.layer.masksToBounds = YES;
        //给图层添加一个有色边框
        _view2.layer.borderWidth = 1;
        _view2.layer.borderColor = [[UIColor colorWithRed:204.0/255.0 green:204.0/255.0 blue:204.0/255.0 alpha:1] CGColor];
        //按钮
        UIButton *btn2 = [[UIButton alloc] init];
        //添加
        [self.view2 addSubview:btn2];
        btn2.sd_layout.leftSpaceToView(self.view2, 50).topSpaceToView(self.view2, 10).heightIs(55).widthIs(55);
        [btn2 setImage:[UIImage imageNamed:@"my_icon_attention_default_hdpi"] forState:UIControlStateNormal];
        [btn2 addTarget:self action:@selector(buttontwo) forControlEvents:UIControlEventTouchUpInside];
        //文字
        UILabel * lb2 = [[UILabel alloc]init];
        lb2.text=@"我的关注";
        lb2.font = [UIFont systemFontOfSize:13];
        //添加
        [self.view2 addSubview:lb2];
        lb2.sd_layout.leftSpaceToView(self.view2, 50).topSpaceToView(self.view2, 55).heightIs(30).widthIs(80);
        //按钮
        UIButton *btn3 = [[UIButton alloc] init];
        //添加
        [self.view2 addSubview:btn3];
        btn3.sd_layout.leftSpaceToView(self.view2, 160).topSpaceToView(self.view2, 10).heightIs(55).widthIs(55);
        [btn3 setImage:[UIImage imageNamed:@"my_icon_rccord_default_hdpi"] forState:UIControlStateNormal];
        [btn3 addTarget:self action:@selector(buttonthree) forControlEvents:UIControlEventTouchUpInside];
        //文字
        UILabel * lb3 = [[UILabel alloc]init];
        lb3.text=@"购票记录";
        lb3.font = [UIFont systemFontOfSize:13];
        //添加
        [self.view2 addSubview:lb3];
        lb3.sd_layout.leftSpaceToView(self.view2, 160).topSpaceToView(self.view2, 55).heightIs(30).widthIs(80);
    }
    return _view2;
}
-(UIView *)view3{
    if (!_view3) {
        //初始化 view
        _view3 = [[UIView alloc]init];
        //添加
        [self.contentView addSubview:self.view3];
        //位置
        _view3.sd_layout.leftSpaceToView(self.contentView,20).topSpaceToView(self.contentView, 202).heightIs(86).widthIs(370);
        //将图层边框设置为圆角
      _view3.layer.cornerRadius = 5;
      _view3.layer.masksToBounds = YES;
      //给图层添加一个有色边框
      _view3.layer.borderWidth = 1;
      _view3.layer.borderColor = [[UIColor colorWithRed:204.0/255.0 green:204.0/255.0 blue:204.0/255.0 alpha:1] CGColor];
        //按钮
        UIButton *btn4 = [[UIButton alloc] init];
        //添加
        [self.view3 addSubview:btn4];
        btn4.sd_layout.leftSpaceToView(self.view3, 50).topSpaceToView(self.view3, 10).heightIs(55).widthIs(55);
        [btn4 setImage:[UIImage imageNamed:@"my_icon_feedback_default_hdpi"] forState:UIControlStateNormal];
        [btn4 addTarget:self action:@selector(buttonfour) forControlEvents:UIControlEventTouchUpInside];
        //文字
        UILabel * lb4 = [[UILabel alloc]init];
        lb4.text=@"意见反馈";
        lb4.font = [UIFont systemFontOfSize:13];
        //添加
        [self.view3 addSubview:lb4];
        lb4.sd_layout.leftSpaceToView(self.view3, 50).topSpaceToView(self.view3, 55).heightIs(30).widthIs(80);
        //按钮
        UIButton *btn5 = [[UIButton alloc] init];
        //添加
        [self.view3 addSubview:btn5];
        btn5.sd_layout.leftSpaceToView(self.view3, 160).topSpaceToView(self.view3, 10).heightIs(55).widthIs(55);
        [btn5 setImage:[UIImage imageNamed:@"my_icon_version_default_hdpi"] forState:UIControlStateNormal];
        [btn5 addTarget:self action:@selector(buttonfive) forControlEvents:UIControlEventTouchUpInside];
        //文字
        UILabel * lb5 = [[UILabel alloc]init];
        lb5.text=@"最新版本";
        lb5.font = [UIFont systemFontOfSize:13];
        //添加
        [self.view3 addSubview:lb5];
        lb5.sd_layout.leftSpaceToView(self.view3, 160).topSpaceToView(self.view3, 55).heightIs(30).widthIs(80);
        //按钮
        UIButton *btn6 = [[UIButton alloc] init];
        //添加
        [self.view3 addSubview:btn6];
        btn6.sd_layout.leftSpaceToView(self.view3, 270).topSpaceToView(self.view3, 10).heightIs(55).widthIs(55);
        [btn6 setImage:[UIImage imageNamed:@"my_icon_logout_default_hdpi"] forState:UIControlStateNormal];
        [btn6 addTarget:self action:@selector(buttonsix) forControlEvents:UIControlEventTouchUpInside];
        //文字
        UILabel * lb6 = [[UILabel alloc]init];
        lb6.text=@"退出登录";
        lb6.font = [UIFont systemFontOfSize:13];
        //添加
        [self.view3 addSubview:lb6];
        lb6.sd_layout.leftSpaceToView(self.view3, 270).topSpaceToView(self.view3, 55).heightIs(30).widthIs(80);
    }
    return _view3;
}
-(void)buttonone{
    if (self.btnClickBlock) {
        self.btnClickBlock(1);
    }
}
-(void)buttontwo{
    if (self.btnClickBlock) {
        self.btnClickBlock(2);
    }
}
-(void)buttonthree{
    if (self.btnClickBlock) {
        self.btnClickBlock(3);
    }
}
-(void)buttonfour{
    if (self.btnClickBlock) {
        self.btnClickBlock(4);
    }
}
-(void)buttonfive{
    if (self.btnClickBlock) {
        self.btnClickBlock(5);
    }
}

-(void)buttonsix{
    if (self.btnClickBlock) {
        self.btnClickBlock(6);
    }
}





@end
